import pandas as pd
import matplotlib
matplotlib.use('TkAgg')

matplotlib.rcParams["font.family"] = 'SimHei'
#
matplotlib.rcParams['axes.unicode_minus'] = False
import matplotlib.pyplot as plt


df = pd.read_excel(io=rf'D:\Desktop\mynewlearn\pandas.xlsx', sheet_name='Sheet2', index_col='项目名称（勿修改）')

df = df.loc[df['四化一类'].apply( \
    lambda a: a == '民生工程' \
    )].loc[df['四化二类'].apply( \
    lambda a: a == '教育' \
    )].loc[df['区县'].apply( \
    lambda a: a == '白云区' \
    )]

df.sort_values(by=['总投资'], inplace=True, ascending=[True])

for i in df.index:
    print(df['上会名称'].at[i], df['总投资'].at[i], sep='\t')


df.plot.bar(x='上会名称', y='总投资', color='red', title='我就是试试')

plt.tight_layout()
plt.show()








